package com.java.yz.day14.Daemon;

public class DaemonThreadDemo {
    public static void main(String[] args) {
        MyDaemonThread t1 = new MyDaemonThread();
        MyDaemonThread t2 = new MyDaemonThread();
        MyDaemonThread t3 = new MyDaemonThread();

        //后台线程在别的资料中称之为守护线程
        t1.setName("刘备");
        t2.setName("关羽");
        t3.setName("张飞");

        t2.setDaemon(true);
        t3.setDaemon(true);
        //可以发现t1进程执行完之后，t2进程也会执行结束，但是他不是全部执行完，他就直接执行一会再执行结束

        t1.start();
        t2.start();
        t3.start();
    }
}
